<?php

/*
 * Victory
 * 
 * 4$
 * 
 * Worth 1 Victory Point for every 4 Victory cards in your deck (round down).
 * 
 */

class SilkRoad extends Card implements iVictory, iKingdom, iHinterlands {

    public function __construct() {
        parent::__construct("Silk Road", 4);
        $this->undoPlay = false;
        $this->undoBuy = true;
    }

    
    public function getDescription() {
        return array(
            "Worth 1 Victory Point for every 4 Victory cards in your deck (round down).");
    }

 public function getVictoryPoints(Game $game, $name) {
       $all_cards = $game->getAllCards($name);
        $victory_num = 0;
        foreach ($all_cards as $card) {
            if ($card instanceof iVictory) {
                $victory_num++;
            }
        }
        return (floor($victory_num/4));
    }
}